package sanshui.system.trade.factory.trade.worker;

import lombok.Data;
import sanshui.system.trade.model.TradeResultModel;

@Data
public class WorkerResult {
    boolean flg;
    String msg;
    TradeResultModel resultModel;

    public static WorkerResult success(String msg, TradeResultModel resultModel){
        WorkerResult workerResult = new WorkerResult();
        workerResult.setFlg(true);
        workerResult.setMsg(msg);
        workerResult.setResultModel(resultModel);
        return workerResult;
    }

    public static WorkerResult fail(String msg){
        WorkerResult workerResult = new WorkerResult();
        workerResult.setFlg(false);
        workerResult.setMsg(msg);
        workerResult.setResultModel(null);
        return workerResult;
    }
}
